# ###############################################
# Allow unit tests to be disabled via command
# line or the CMake GUI.
OPTION( BUILD_UNIT_TESTS "Build unit tests." ON )


# ###############################################
# With Xcode we can target iOS.
IF( CMAKE_GENERATOR STREQUAL Xcode )
	OPTION( TARGET_IOS "Compile for iOS." OFF )
ENDIF()


# ###############################################
# Setup for intel sse.
CMAKE_DEPENDENT_OPTION( SIMD_SSE "Enable compilation of Intel SSE" ON "NOT TARGET_IOS" OFF )

# Set up dependency chains for the level of instruction support.
# Default to SSE 2 as the most commonly available version of SSE.
CMAKE_DEPENDENT_OPTION( SIMD_SSE_2 "Level of Intel SSE=2" ON "SIMD_SSE" OFF )
CMAKE_DEPENDENT_OPTION( SIMD_SSE_3 "Level of Intel SSE=3" OFF "SIMD_SSE_2" OFF )
CMAKE_DEPENDENT_OPTION( SIMD_SSE_3_1 "Level of Intel SSE=3.1" OFF "SIMD_SSE_3" OFF )
CMAKE_DEPENDENT_OPTION( SIMD_SSE_4 "Level of Intel SSE=4" OFF "SIMD_SSE_3_1" OFF )
CMAKE_DEPENDENT_OPTION( SIMD_SSE_AVX "Level of Intel SSE=AVX" OFF "SIMD_SSE_4" OFF )

# Set up alternative target for VMX.
CMAKE_DEPENDENT_OPTION( SIMD_ALTIVEC "Enable Power PC Altivec." OFF "NOT TARGET_IOS AND NOT SIMD_SSE AND NOT SIMD_NEON" OFF )

# Set up alternative target for ARM Neon.
CMAKE_DEPENDENT_OPTION( SIMD_NEON "Enable ARM Neon." OFF "TARGET_IOS AND NOT SIMD_SSE AND NOT SIMD_ALTIVEC" OFF )


# ###############################################
# Enable the CMake built in CTest system if unit
# tests are enabled.
IF( BUILD_UNIT_TESTS )
	ENABLE_TESTING()
ENDIF( BUILD_UNIT_TESTS )

